package com.zhiziai.aiproxy.utils;

/**
 * @author: liuxinyu06
 * @description:
 * @create: 2023-05-26
 **/
public class SignUtil {
    static String salt = "nZxeZdXhUQEC5EO2yD9Ofc57KwoamjvxoiSypEtDhFQ";

    public static String buildSign(String... params) {
        StringBuffer buffer = new StringBuffer();
        for (int i = 0; i < params.length; i++) {
            String param = params[i];
            buffer.append(param);
        }
        buffer.append(salt);
        String md5str = MD5Util.encode(buffer.toString());
        String sign = md5str.toLowerCase().substring(10, 20);
        return sign;
    }

    public static void main(String[] args) {
        buildSign("1","closeup gorgeous gal enjoying an enchanted evening in an amazing modern utopia , I can't believe how beautiful this is","4");
    }
}
